import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        for(int i = 0; i < n; i++) {
            long x = in.nextLong();
            int left = 3;
            int right = 1000001;
            int result = 3;
            while(left <= right) {
                int mid = left + (right-left)/2;
                long product = (long) mid * (mid - 1) * (mid - 1);
                if (product >= x) {
                    result = mid;
                    right = mid - 1;
                }else {
                    left = mid + 1;
                }
            }
            System.out.println(result);
        }

    }
    public static void main1(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        for(int i = 0; i < n; i++) {
            int x = in.nextInt();
            int k = 3;
            for(;;k++) {
                int tmp = k*(k-1)*(k-1);
                if(tmp >= x) {
                    break;
                }
            }
            System.out.println(k);
        }
    }
}